import Vue from 'vue'
import App from './App'
import store from './store'
import appInitializer from './utils/appInit.js'

Vue.config.productionTip = false

// 初始化应用安全机制
appInitializer.init().catch(error => {
  console.error('应用初始化失败:', error)
})

// 简化插件注册，避免循环依赖
try {
  const { WechatPlugin } = require('./utils/plugins')
  Vue.use(WechatPlugin)
} catch (error) {
  console.warn('插件加载失败:', error)
}

App.mpType = 'app'

const app = new Vue({
  store,
  ...App
})
app.$mount()